<!DOCTYPE html>
<html>
<head>
    <title>{% block title %}SimpleTrade{% endblock %}</title>
    <link rel="icon" type="image/png" href="{{ url_for('static', filename='ai-icon.png') }}">
    <style>
        body { font-family: Arial, sans-serif; max-width: 1200px; margin: 0 auto; padding: 20px; }
        .header { margin-bottom: 20px; }
        .header h1 { margin: 0 0 15px 0; color: #2c3e50; }

        /* 导航栏样式 */
        .nav-bar {
            background: #f8f9fa;
            padding: 12px 15px;
            border-radius: 8px;
            margin-bottom: 25px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
        .nav-links {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
        }
        .nav-links li { margin: 0; }
        .nav-links a {
            text-decoration: none;
            color: #3498db;
            font-size: 1em;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .nav-links a:hover {
            color: #2980b9;
            text-decoration: underline;
        }
        .nav-links a.active {  /* 当前页面导航高亮 */
            color: #2980b9;
            font-weight: 600;
            text-decoration: underline;
        }

        .status-bar {
            color: #666;
            font-size: 0.9em;
            margin-top: 30px;
            text-align: right;
            padding: 10px 0;
            border-top: 1px solid #eee;
        }

        .main-content {
            background: white;
            border-radius: 8px;
            padding: 25px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            min-height: 400px;  /* 避免内容过短时布局错乱 */
        }
        .section-title {
            color: #2c3e50;
            border-bottom: 2px solid #3498db;
            padding-bottom: 8px;
            margin-top: 0;
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .nav-links { gap: 12px; }
            .nav-links a { font-size: 0.9em; }
            .main-content { padding: 15px; }
        }
    </style>
    {% block extra_css %}{% endblock %}  <!-- 留给子页面扩展CSS -->
</head>
<body>
    <div class="header">
        <h1>SimpleTrade</h1>

        <!-- 顶部导航栏（所有页面共用） -->
        <div class="nav-bar">
            <ul class="nav-links">
                <li><a href="/" class="{% if request.path == '/' %}active{% endif %}">🏠 首页</a></li>
                <li><a href="/market/sentiment" class="{% if request.path == '/market/sentiment' %}active{% endif %}">📉 行情</a></li>
                <li><a href="/evaluation" class="{% if request.path == '/evaluation' %}active{% endif %}">📊 完整评估结果</a></li>
                <li><a href="/latest-valuation" class="{% if request.path == '/latest-valuation' %}active{% endif %}">📈 最新估值</a></li>
                <li><a href="/fund-config" class="{% if request.path == '/fund-config' %}active{% endif %}">📝 基金配置管理</a></li>
                <li><a href="/scheduler/status" class="{% if request.path == '/scheduler/status' %}active{% endif %}">⏰ 定时任务状态</a></li>
                <li><a href="/history" class="{% if request.path == '/history' %}active{% endif %}">📜 历史评估记录</a></li>
                <li><a href="/help" class="{% if request.path == '/help' %}active{% endif %}">❓ 使用说明</a></li>
            </ul>
        </div>
    </div>

    <!-- 子页面内容区域 -->
    <div class="main-content">
        {% block content %}{% endblock %}  <!-- 子页面内容将填充到这里 -->
    </div>

    {% block extra_js %}{% endblock %}  <!-- 留给子页面扩展JS -->
</body>
</html>